﻿namespace Yunzuan.Common
{
    public class SystemSetting
    {
        public dynamic setting = null;
         
        ////////////////////////////////裸钻 Loose Diamond      SysSettingID=1////////////////////////////////////////////
         

        /// <summary>
        /// 全局销售汇率 -裸钻
        /// </summary>
        /// <returns></returns>
        public decimal GetRate()
        {
            if (setting.Rate.HasValue && setting.Rate > 0)
            {
                return setting.Rate.Value;
            }
            return 1;
        }


        /// <summary>
        /// 全局采购汇率 - 裸钻
        /// </summary>
        /// <returns></returns>
        public decimal GetPurchaseExchangeRate()
        {
            if (setting.PurchaseExchangerate.HasValue && setting.PurchaseExchangerate > 0)
            {
                return setting.PurchaseExchangerate.Value;
            }
            return 1;
        }


        /// <summary>
        /// 全局白钻退点
        /// </summary>
        /// <returns></returns>
        public decimal GetGlobalDiscountReturn()
        {
            if (setting.GlobalDiscountReturn.HasValue)
            {
                return setting.GlobalDiscountReturn.Value;
            }
            return 0;
        }

        /// <summary>
        /// 全局彩钻退点
        /// </summary>
        /// <returns></returns>
        public decimal GetGlobalFancyDiscountReturn()
        {
            if (setting.GlobalFancyDiscountReturn.HasValue)
            {
                return setting.GlobalFancyDiscountReturn.Value;
            }
            return 0;
        }



        //public enum SystemSettingType
        //{
        //    /// <summary>
        //    /// 裸钻
        //    /// </summary>
        //    Stock = 1,
        //    /// <summary>
        //    /// 统包
        //    /// </summary>
        //    Parcel = 2,
        //    /// <summary>
        //    /// 成品
        //    /// </summary>
        //    Ring = 3,
        //    /// <summary>
        //    /// 彩宝
        //    /// </summary>
        //    Gem = 4,
        //    /// <summary>
        //    /// 翡翠
        //    /// </summary>
        //    Emerald = 5,
        //    /// <summary>
        //    /// 素金
        //    /// </summary>
        //    PrimeGolds = 6,
        //    /// <summary>
        //    /// 素金
        //    /// </summary>
        //    InlaySettings = 7


        //}
    }
}
